<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE HTML>
<html lang="cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分享</title>
<%@ include file="../include/include.jsp"%>
<script type="text/javascript" src="./js/fg/share/share.js" ></script>

<script type="text/javascript">
$(function() {
    $("textarea[maxlength]").keyup(function() {
        var area = $(this);
        var max = parseInt(area.attr("maxlength"), 10);
        if (max > 0) {
            if (area.val().length > max) { 
                area.val(area.val().substr(0, max)); 
            }
        }
    });
    $("textarea[maxlength]").blur(function() {
        var area = $(this);
        var max = parseInt(area.attr("maxlength"), 10); 
        if (max > 0) {
            if (area.val().length > max) { 
                area.val(area.val().substr(0, max)); 
            }
        }
    });
}); 
</script>

</head>
<body style="overflow: inherit;" class="no-subnav page-home">
<c:import url="/jsp/fg/include/default_head.jsp">
	<c:param name="menu" value="3" />
</c:import>
<form id="share">
<div class="container ">
	<div id="content">
		<div class="teaser alt">
			<div class="container">
			</div>
		</div>
		
		<input type="hidden" name="commodityBean.commodityInfo.picPath" id="hiddenPicPath">
		<input type="hidden" name="commodityBean.favoriteId" id="favoriteId">
		<div class="wrapper-content">
			<div class="shareIcon">
				<img src="./images/feground/img.png"/><span>图片分享</span>
			</div>
			<div class="stream">
				<div class="upload">
					<div class="al-prepost">
						<div class="al-covb" >
							点击上传图片
							<div id="user_commodity_image">
							</div>
							<input type="file" id="commodityPic" name="commodityPic" class="button sign file"  size="1" hidefocus>
						</div>
						<div class="publish">
							<div class="al-size gray">
								· 仅支持jpg、gif、png图片格式 <br>
								· 文件要小于2M <br>
								· 图片分辨率要大于200x200
							</div>
							<div class="loadimg">
								<input type="text" onclick="commodityPic.click()" class="input" style="display:none;">
								<button id="continue" type="button" class="button sign"  onclick="">继续</button>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		
	</div>	
	<div class="shareArea" id="shareArea" style="display:none">
		<div class="share-mark">&nbsp;
		</div>
		<div class="share-mark-line">&nbsp;
		</div>
		<div class="shareBody">
			<span>商品标题</span>
			<div class="cmt-ctnt pr">
				<textarea class="txa sffocus jqPlaceholder" placeholder="请输入商品标题，长度不超过32位...必填项" maxlength="32" name="commodityBean.commodityInfo.title" id="commodityTitle" style="overflow: hidden; height: 44px;"></textarea>
			</div>
			<span>商品标签(多个标签以空格相隔)</span>
			<div class="cmt-ctnt pr">
				<textarea class="txa sffocus jqPlaceholder"  name="commodityBean.commodityInfo.lables"   placeholder="请输入标签,多个以空格相隔...最多不能超过三个标签,必填项" id="commodity_lables"  style="overflow: hidden; height: 44px;"></textarea>
			</div>
			<span>我的标签</span>
			<div class="usetag clr usetagpop" >
				<c:forEach items="${userCommonLables}" var="label" varStatus="item">
					<a id="user_lable_${item.index }" href="javascript:selectLable('user_lable_${item.index }' ,'${label}')"><c:out value="${label}"/></a>
				</c:forEach>
			</div>
			<span>常用标签</span>
			<div class="usetag clr usetagpop" >
				<c:forEach items="${commonLables}" var="label" varStatus="item">
					<a id="common_lable_${item.index }" href="javascript:selectLable('common_lable_${item.index }' ,'${label}')"><c:out value="${label}"/></a>
				</c:forEach>
			</div>
			<span>网址链接</span>
			<div class="cmt-ctnt pr">
				<textarea class="txa sffocus jqPlaceholder" placeholder="请输入链接或购买地址...." maxlength="200" name="commodityBean.commodityInfo.buyAddress" id="commodityBean.commodityInfo.buyAddress" style="overflow: hidden; height: 44px;"></textarea>
			</div>
			<span>价格</span>
			<div class="cmt-ctnt pr">
				<textarea class="txa sffocus jqPlaceholder"  placeholder="请输入价格...."  maxlength="100" name="commodityBean.commodityInfo.price" id="commodityBean.commodityInfo.price" style="overflow: hidden; height: 44px;"></textarea>
			</div>
			<span>简述</span>
			<div class="cmt-ctnt pr">
				<textarea class="txa sffocus jqPlaceholder"  placeholder="请输入简介...."  maxlength="1000"  name=commodityBean.commodityInfo.uploaderDesc id="commodityBean.commodityInfo.uploaderDesc" style="overflow: hidden; height: 44px;"></textarea>
			</div>
			<span>我的收藏夹</span>
			<div class="usetag clr usetagpop" id="myfavorite_div">
				<c:forEach items="${userCommidityFavorites}" var="favorite" varStatus="item">
						<a id="favorite_${favorite.favoriteId }" href="javascript:selectFavorite('${favorite.favoriteId }')"><c:out value="${favorite.favoriteName}"/></a>
				</c:forEach>
			</div>
			<div class="cmt-ctnt win-rreply">
				<a href="#" class="rreply">新建收藏夹</a>
				<div class="l cmt-related">
					<input type="text" class="favInput" maxlength="40" value="" id="new-fav" class="ipt l" autocomplete="off" style="margin-top:2px !important;width:250px;">
					<button type="button" onclick="javascript:addFav();" class="button sign">新建收藏夹</button>
				</div>
			</div>
			<div style="text-align:right;">		<button type="button" class="button sign" id="publish" >发布</button></div>
		</div>
	</div>
</div>
</form>

</body>
</html>